/*********************************************************
          File Name:16.39.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Wed 16 Dec 2015 10:15:03 PM CST
**********************************************************/

#include <iostream>

template<typename T>
int compare(const T &a, const T &b)
{
        if(a < b)
                return -1;
        if(b < a)
                return 1;

        return 0;
}

int main()
{
        int res = compare("abc", "ef");         // not match `char[3]` and char[2] 

        int ret = compare("abc", "efg");        // the same type

        std::cout << compare<std::string>("abc", "ef") << std::endl; // explicit template argument, tell compiler convert `const char *` to `std::string`

        return 0;
}
